package com.ldf.media.api.controller;

import com.ldf.media.config.MediaServerConfig;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 视频通话控制器
 *
 * @author your-name
 * @since 2025/08/06
 */
@Slf4j
@Controller
@RequestMapping("/video-call")
@Api(tags = "【API】视频通话接口")
@RequiredArgsConstructor
public class VideoCallController {
    
    private final MediaServerConfig mediaServerConfig;
    
    /**
     * 视频通话页面
     *
     * @param model 模型
     * @return 视频通话页面
     */
    @ApiOperation(value = "视频通话页面")
    @GetMapping
    public String videoCall(Model model) {
        // 将域名传递给前端页面
        model.addAttribute("domain", mediaServerConfig.getDomain());
        return "video_call";
    }
}